<form
  id="{{ form_type }}-form"
  class="form-horizontal form-label-left add-id"
  method="post"
  autocomplete="off"
>
  <div class="modal-body">
    <div class="form-group">
      <input type="hidden" id="copy" name="copy" class="add-id" />
      <div id="content" class="add-id" style="height: 100%;"></div>
      {% for field in form %} {% set id = "{}-{}".format(form_type, field.name) %} {%
      set style = "height: {}px".format(field.render_kw["rows"]*20 + 17) if "TextArea"
      in field.widget|string else "" %}
      <div id="{{ id }}-div" class="add-id" style="{{ style }}">
        {% set class = "form-control-bool" if field.type == "BooleanField" else
        "form-control" %} {% if field.widget.input_type == 'hidden' %} {{ field(id=id,
        class="add-id") }} {% else %} {% if field.render_kw and "help" in
        field.render_kw %}
        <label
          class="control-label col-md-3 col-sm-3 col-xs-12"
          help="{{ field.render_kw['help'] }}"
          for="{{ field.name }}"
        >
          {{ field.label }}
        </label>
        {% else %}
        <label class="control-label col-md-3 col-sm-3 col-xs-12"
          >{{ field.label }}</label
        >
        {% endif %}
        <div class="col-md-9 col-sm-9 col-xs-12">
          {{ field(id=id, class="collapsed {} add-id".format(class),
          checked=field.default) }}
        </div>
        <br /><br />
        {% endif %}
      </div>
      {% endfor %}
    </div>
    {% if action %}
    <center>
      <button
        id="{{ form_type }}-action-btn"
        type="button"
        class="btn btn-{{ button_class }} add-id btn-id"
        value="{{ action }}"
      >
        {{ button_label }}
      </button>
    </center>
    {% endif %}
  </div>
</form>
